<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>猴子校园二手街-用户登录</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<!-- 
	<link rel="stylesheet" type="text/css" href="../css/login.css">
	-->
	<script language="javascript">
		function check(){
				if(document.getElementById("username").value==""){
					alert("用户名不可为空！");
					document.getElementById("username").focus();
					return false;
				}
				if(document.getElementById("password").value==""){
					alert("密码不可为空！");
					document.getElementById("password").focus();
					return false;
				}
				var temp = document.getElementById("verifycode");
				var safecodeStr = /^([a-zA-Z0-9]){4}$/;
				if(!safecodeStr.test(temp.value)){
					alert('安全码必须由4位的数字和小写字母组成！');
					temp.focus();
					return false;
				}
				return true;
			}
			
		function myReload() {
			document.getElementById("image").src = document
					.getElementById("image").src
					+ "?nocache=" + new Date().getTime();
		}
	</script>
  </head>
  
  <body>
    <h1 align="center">猴子校园二手街</h1>
	<h2 align="center">用户登录</h2>
	
	
	<form action="<%=basePath%>user/login.do" method="post">

	用户名：<input type="text" name="username"  id="username" />
	<br>
	密&nbsp;&nbsp;码：<input type="password" name="password" id="password" />
	<br>
           验证码：	<input name="verifycode" type="text"  id="verifycode"/>
           <img src="user/verifycode.do" id="image" align="middle">
           <a href="" onclick="myReload()"> 看不清,换一个</a>
        <!--  
        <input name="verifycode" id="verifycode" type="text" />
        <img src="<%=basePath%>user/verifycode.do" id="image" />
        <a href="" id="flush">看不清？点击刷新</a>
		-->
		<br>
		<input type="submit" name="submit" onClick="return check()"	value="登录" />
		<input type="reset" name="submit" value="重置" />&nbsp;&nbsp;
		<a href="jsp/regist.jsp">注册新用户</a>
	
	
	</form>
	
  </body>
</html>
